package top.revery.api.api.task;

import org.springframework.web.bind.annotation.*;

import top.revery.api.config.UserPageData;
import top.revery.api.entity.task.BaseCompetePrice;
import top.revery.api.entity.task.BaseTask;
import top.revery.api.entity.vo.BaseTaskUser;

import top.revery.api.entity.user.BaseUserInfo;

import java.util.List;
import java.util.Map;

/**
 * @author denghao
 * @title
 * @package
 * @date 2019/12/13 19:15
 */
@RequestMapping("/api_task")
public interface ITaskApi {

    //分页多条件查询所有
    @PostMapping("/getList")
    public UserPageData getList(@RequestParam(value = "pageNum") int pageNum, @RequestParam(value = "pageSize") int pageSize,
                                @RequestBody Map map);
    //根据公司的名字查询任务
    @PostMapping("/getCompanyName")
    public List<BaseTaskUser> getCompanyName(@RequestParam(value = "pageNum") int pageNum, @RequestParam(value = "pageSize") int pageSize,
                                             @RequestParam("companyName") String companyName);

    //保存任务
    @PostMapping("/save")
    public BaseTask save(@RequestBody BaseTask baseTask) throws Exception;


    //发布任务
    @PostMapping("/pubTask")
    public void pubTask(@RequestBody BaseTask baseTask,@RequestParam("id") Long id)throws Exception;


    //修改任务
    @PostMapping("/updateTask")
    public BaseTask updateTask(@RequestBody BaseTask baseTask) throws Exception;

    //网红投递任务
    @PostMapping("/deliver")
    public BaseTask deliverTask(@RequestBody BaseTask baseTask,@RequestParam("id") Long id)throws Exception;


    //接受任务
    @PostMapping("/statusTask")
    public void statusTask(@RequestParam("id") Long id,@RequestBody BaseUserInfo baseUserInfo) throws Exception;

    //上传作品
    @PostMapping("/uploadTask")
    public void uploadTask(@RequestBody BaseTask baseTask,@RequestParam(value = "worksAddress") String worksAddress) throws Exception;

    //企业作品是否同意作品
    @PostMapping("/isfoGetTask")
    public void isfoGetTask(@RequestBody BaseTask baseTask,@RequestParam(value = "type") Integer type);

    //取消任务
    @PostMapping("/cncelTask")
    public void cncelTask(@RequestBody BaseTask baseTask,@RequestParam("companyId")Long companyId) throws Exception;

    //企业任务统计
    @PostMapping("/countTask")
    public Map<String,Long> countTask(@RequestParam("id") Long id);

    //网红任务统计
    @PostMapping("/countKolTask")
    public Map<String,Long> countKolTask(@RequestParam("id") Long id);


    //任务结算
    @PostMapping("/companyStausTask")
    public void companyStausTask(@RequestBody BaseTask baseTask) throws Exception;


    //添加竞价
    @PostMapping("/add")
    public void add(@RequestBody BaseCompetePrice baseCompetePrice);
    @PostMapping("/update")
    public void update(@RequestBody BaseCompetePrice baseCompetePrice,@RequestParam("id") Long id);
    //分页查询竞价
    @PostMapping("/competeList")
    public UserPageData competeList(@RequestParam(value = "pageNum") int pageNum, @RequestParam(value = "pageSize") int pageSize
            ,@RequestBody Map map);

    //启用竞价
    @PostMapping("/updateState")
    public BaseCompetePrice updateState(@RequestParam("id") Long id,@RequestParam("companyId")Long companyId) throws Exception;

    //是否推广进入
    @PostMapping("/getType")
    public BaseTaskUser getType(@RequestParam("type") Long type,@RequestParam("taskId") Long taskId)throws Exception;
    
}
